<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>index.js</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            index.js
        </h1>
        <ul class="files">
            
            <li>
                lib/assets/javascripts/ruiqu_app/store_products/index.js
                
            </li>
            <li>Last modified: 2017-01-30 17:13:35 +0800</li>
        </ul>
    </div>

    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>jQuery(function($){</p>

<pre><code>$(&quot;a.js-to-unshow-product&quot;).on(&quot;click&quot;, function(e){
  e.preventDefault();
  var id = $(this).data(&quot;id&quot;);
  var _this = this
  var csrf = $(&quot;input#js-ruiqu-store-product-index&quot;).val();
  $.ajax({
    url: &quot;/api/store_products/&quot;+ id +&quot;/toggle&quot;,
    method: &quot;put&quot;,
    headers: {
              &#39;X-CSRF-Token&#39;: csrf
            },
    success: function(data){
      if (data.showable){
        $(_this).text(&quot;屏蔽显示&quot;);
        $(_this).parent().siblings(&quot;td.js-showable&quot;).text(&quot;前台显示&quot;);
      }else {
        $(_this).text(&quot;开启显示&quot;);
        $(_this).parent().siblings(&quot;td.js-showable&quot;).text(&quot;前台屏蔽&quot;);
      }
    }
  })
});</code></pre>

<p>})</p>

    </div>
  


  


  
  


  


  

  



  

    

    

    


    


    <!-- Methods -->
              </div>

    </div>
  </body>
</html>
